<?php
namespace com\mvc\model;

use com\mvc\core\Request;
class GenericModel extends \com\mvc\model\ModelData{
	public function __construct(){
		//parent::__construct($name, $firstname, $age, $address, $telephone);
	}
	public function model($path){
		
		$var = array();
		if (isset($_POST) && $_POST!=null){
			$var['post'] = &$_POST;
		}
		if (isset($_GET) && $_GET!=null){
			$var['get'] = &$_GET;
		}
		if (isset($_SESSION) && $_SESSION!=null){
			$var['session'] = &$_SESSION;
		}
		$exists = \com\mvc\tools\FilesTools::existsFile(ROOT_PATH,PATH_VIEWS.ucfirst($path).VIEW.EXTENSION);
		if ($exists){
			$this->render(PATH_VIEWS.ucfirst($path).VIEW.EXTENSION,$var);
		}else{
			$this->render(PATH_VIEWS.ERROR.VIEW.EXTENSION,$var);
		}
	}
}
?>